#!/usr/bin/env python
#-*- coding:utf-8 -*-

"""
	PROJECT pyevocomm -

	APP Parla

	MODULE	model

	SITE DESCRIPTION http://code.google.com/p/pyevocomm/ 

	@copyright: 2012 by archetipo <alessio.gerace@gmail.com>
	@license: New BSD License, see COPYING for details.
"""





import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))

# stdlib
import copy
import random
import weakref

# pyglet related
import pyglet

# cocos2d related
from cocos.euclid import Point2

# tetrico related
from constants import *
from status import status


__all__ = ['Model']

#
# Model (of the MVC pattern)
#

class Model( pyglet.event.EventDispatcher ):

	def __init__(self):
		super(Model,self).__init__()

		# grid
		self.map = {}


	def start( self ):
		pass

	def set_controller( self, ctrl ):
		self.ctrl = weakref.ref( ctrl )
	
	def select(self,val):
		print val

	def close(self,val):
		print val

	def step(self,val):
		print val
		self.dispatch_event("on_step")

	def insel(self,val):
		print val
		self.dispatch_event("on_inselect")

	def lost(self,val):
		print val

	def rigth(self,val):
		print val

	def left(self,val):
		print val

	def single(self,val):
		print val

	def lang(self,val):
		print val
		
	def menu(self,val):
		print val
		
	def draw(self):
		pass





Model.register_event_type('on_select')
Model.register_event_type('on_close')
Model.register_event_type('on_step')
Model.register_event_type('on_inselect')
Model.register_event_type('on_lost')
Model.register_event_type('on_right')
Model.register_event_type('on_left')
Model.register_event_type('on_single')
Model.register_event_type('on_lang')
Model.register_event_type('on_menu')
